<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <table border="1" cellspacing="0" width="60%" style="text-align: center;">
            <tr style="background-color: green; font-size: 25px; font-weight: bold;">
                <td>编号</td>
                <td>姓名</td>
                <td>年龄</td>
                <td>性别</td>
                <td>成绩</td>
                <td>等级</td>
            </tr>
            <!-- 此处数据需要被遍历 -->
            <tr v-for="(user,index) in  users">
                <td>{{index + 1}}</td>
                <td>{{user.name}}</td>
                <td>{{user.age}}</td>
                <td>
                   <span v-if="user.gender == 1">男</span>        
                   <span v-if="user.gender == 2">女</span>        
                </td>
                <td>{{user.score}}</td>
                <td>
                    <span v-if="user.score >= 85">优秀</span>
                    <span v-else-if="user.score >= 60">及格</span>
                    <span style="color: red;" v-else>不及格</span>

                </td>
            </tr>
        </table>


    </div>
    
</body>
</html>
<script>
    new Vue({
        el:'#app',
        data(){
            return {
                //集合数据  在js中时数组
                users:[
                    {
                        name:'Tom',
                        age:18,
                        gender:1,
                        score:75
                    },
                    {
                        name:'Jerry',
                        age:18,
                        gender:2,
                        score:60
                    },
                    {
                        name:'Mike',
                        age:18,
                        gender:1,
                        score:20
                    }
                ]
                
            }
        },
        methods:{
            inint(){
                // this.users= 获取的数据库的全部数据;
            }
        }
    });
</script>